#ifndef UDPSOCKETGROUP_H
#define UDPSOCKETGROUP_H

#include <QObject>
#include <QNetworkInterface>
#include "udpsocketbase.h"

#include "head.h"

class UdpSocketGroup : public UdpSocketBase
{
    Q_OBJECT
public:
    UdpSocketGroup(const QString mac);

    virtual bool bind_multicast(QHostAddress ip, uint16_t port);
    virtual void quit_multicast();
    virtual qint64 send_msg(QByteArray msg, QString addr="", int port = 0);


private:
    QHostAddress _groupAddress;
    uint16_t _groupPort;

    QNetworkInterface _thisNet;
    QString m_mac = "";

};

#endif // UDPSOCKETGROUP_H
